<template>
	<view>
		<image v-if="!listarr" class="bg" src="../../static/image/bj_36.png"></image>
		<view class="list">
			<view>{{listarr.content}}</view>
			<view class="times">{{listarr.createtime}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listarr: [],
				stu: '',
				group_id:''
			}
		},
		onLoad(options){
			this.group_id = options.group_id;
			if(options.stu){
				this.stu = options.stu;
			}
		},
		onShow(){
			this.$msgchat.initwork();
			this.initDat();
		},
		methods: {
			//初始化数据
			initDat(){
				var obj = {
					token: uni.getStorageSync('token'),
					group_id:this.group_id,
				}
				this.$common.requests('/api/Group/groupnotice', obj).then(res => {
					console.log(res)
					if(res.data.code==1){
						this.listarr = res.data.data;
					}else{
						this.$api.msg(res.data.msg);
						return;
					}
					
				})
			}
		},
		onNavigationBarButtonTap(e) {
			if(this.stu == 1){
				this.$api.msg("无编辑权限")
			}else{
				uni.navigateTo({
					url: '../releaseAnnouncement/releaseAnnouncement?group_id='+this.group_id
				})
			}
			
		}
	}
</script>

<style>
	page {
		border-top: 1px solid #E8E8E8;
	}

	.bg {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
	}

	.list {
		padding: 35upx 0;
		margin: 0 30upx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #E8E8E8;
	}

	.times {
		color: #7A7A7A;
		font-size: 30upx;
	}
</style>
